package utils

// 返回错误码
func RespCode(code int) map[string]interface{} {
	switch code {
	case 0:
		return map[string]interface{}{
			"code": 0,
			"msg":  "success",
		}
	case 500:
		return map[string]interface{}{
			"code": 500,
			"msg":  "server error",
		}
	case 100:
		return map[string]interface{}{
			"code": 100,
			"msg":  "invalid token",
		}
	case 140:
		// 用户不存在
		return map[string]interface{}{
			"code": 140,
			"msg":  "user no exist",
		}
	case 210:
		return map[string]interface{}{
			"code": 210,
			"msg":  "event no exist",
		}
	}

	return nil
}
